import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { GangFightsMeritData } from "../data/GangFightsMeritData";
import { ItemData } from "../../../resource/info/ItemData";
import { ItemsUtil } from "../../shortcuts/item/ItemsUtil";
import { ToolTipsManager } from "../../../../../com/mui/manager/ToolTipsManager";
import { NormalTooltip } from "../../common/tooltip/NormalTooltip";
import { Language } from "../../../../../extend/language/Language";
//class GangFightsMeritCellRenderer
    
    export  class GangFightsMeritCellRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createBg(0, 0, 520, 2, this, "SplitLine");
            var loc1=GlobalStyle.getTextFormatCenter(GlobalStyle.textFormat1);
            this._tfRank = ObjCreate.createTextField("", 0, 7, 75, 20, this, loc1);
            this._tfReward = ObjCreate.createTextField("", 110, 7, 140, 20, this, loc1);
            this._tfReward2 = ObjCreate.createTextField("", 290, 7, 230, 20, this, loc1);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            if (typeof arg1 === "gangfightsmeritdata") 
            {
                this._meritData = arg1 as GangFightsMeritData;
                this.updateView();
            }
            return;
        }

        /* internal  */updateView(): void
        {
            var loc1=null;
            this._tfRank.text = this._meritData.rank;
            this._tfReward.text = this._meritData.merit;
            if (this._meritData.itemCode > 0) 
            {
                loc1 = new ItemData(this._meritData.itemCode);
                this._tfReward2.htmlText = this._meritData.merit2 + "; <u>" + ItemsUtil.getItemName(loc1) + "</u>";
                ToolTipsManager.register(this._tfReward2, NormalTooltip, loc1.getToolTipData());
            }
            else 
            {
                this._tfReward2.text = Language.getString(20400);
            }
            return;
        }

        /* internal */ /* var */_meritData: GangFightsMeritData;

        /* internal */ /* var */_tfRank: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfReward: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfReward2: Object /* flash.text.TextField */;
    }
